(function ($, window, document, undefined) {

$(document).ready(function() {
	
	$klass = $.klass;
	$proto = $klass.prototype;
	$trait = $.trait;
	Trait = $klass.Trait;
	
	module("Wiki PrivateProperties");
	
	test("", function() {
		
	// Private properties
		Image = $.klass({
		  _private: {
			init: function( privateProps, name ) {
			  privateProps.fileName = name + ".png";
			},
			getSrc: function( privateProps, withPath ) {
			  return ( withPath ? "images/" : "" ) + privateProps.fileName;
			},
			tryToGetValue: function( privateProps ) {
			  return privateProps.value;
			}
		  }
		});
		
		Icon = $.klass( Image, {
		   init: function( type ) {
			this._super( arguments, type );
		  },
		  _private: {
			setValue: function( privateProps, value ) {
			  privateProps.value = value;
			},
			getValue: function( privateProps ) {
			  return privateProps.value;
			},
			tryToGetFileName: function( privateProps ) {
			  return privateProps.fileName;
			},
			askNicelyForFileName: function( privateProps ) {
			  return this._super( "getSrc", arguments, false );
			}
		  }
		});
		
		icon = new Icon( "info" );
		strictEqual(icon.getSrc( true ), "images/info.png", 'icon.getSrc( true )');  // => "images/info.png"
		icon.setValue( 42 );
		strictEqual(icon.getValue( ), 42, 'icon.getValue( )');  // => 42
		
		// Here we see clearly that methods from one class don't have access to private properties of another class:
		strictEqual(icon.tryToGetValue( ), undefined, 'icon.tryToGetValue( )');  // => undefined
		strictEqual(icon.tryToGetFileName( ), undefined, 'icon.tryToGetFileName( )');  // => undefined
		
		// Any other feature works as expected. For example let's try super method call:
		strictEqual(icon.askNicelyForFileName( ), "info.png", 'icon.askNicelyForFileName( )');  // => "info.png"
	});
});

})(jQuery, window, window.document);